/*
 * These are some predefined glue listeners that you can
 *  modify to fit your application.
 *
 * This file should not placed in the /resources directory of your application
 * as that directory is for jmaki specific resources.
 */


// uncomment to turn on the logger
jmaki.debug = false;
// uncomment to show publish/subscribe messages
jmaki.debugGlue = false;

// map topic dojo/fisheye to fisheye handler
jmaki.subscribe("/dojo/fisheye*", function(args) {
    jmaki.log("glue.js : fisheye event");
 });


// map topics ending with  /onSave to the handler
jmaki.subscribe("*onSave", function(args) {
    jmaki.log("glue.js : onSave request from: " + args.id + " value=" + args.value);
});

// map topics ending with  /onSave to the handler
jmaki.subscribe("*onSelect", function(args) {
    jmaki.log("glue.js : onSelect request from: " + args.widgetId);
});

// map topics ending with  /onSave to the handler
jmaki.subscribe("*onClick", function(args) {
    jmaki.log("glue.js : onClick request from: " + args.widgetId);
});

jmaki.subscribe("/dojo/fisheye*", function(args) {
    switch (args.message.value) {
    case 'inicio' : {
    location.assign("inicio.jsp");
    return;
    }
    
    case 'inicio_espacio' : {
    location.assign("../privado/inicio.jsp");
    return;
    }
    case 'espacio_actual' :{
    location.assign("../espacio/espacio.jsp");
    return;
    }
    case 'perfil' : {
    // clear the rows
    location.assign("perfil.jsp");
    return;
    }
    case 'salir' : {
    location.assign("../publico/inicio.jsp");
    return;
    }
    case 'docentes' : {
    location.assign("en_desarrollo.jsp");
    return;
    }
    case 'materias' : {
    location.assign("en_desarrollo.jsp");
    return;
    }
    case 'ayuda' : {
    location.assign("en_desarrollo.jsp");
    return;
    }
    case 'avisos' : {
    location.assign("en_desarrollo.jsp");
    return;
    }
    
    case 'foros' : {
    location.assign("../foro/foros.jsp");
    return;
    }
    
    case 'personalizar_roles' : {
    location.assign("personalizar_widgets.jsp");
    return;
    }
    case 'personalizar_widgets' : {
    location.assign("personalizar_widgets.jsp");
    return;
    }
    
    case 'conf_privilegios' : {
    location.assign("configurar_privilegios.jsp");
    return;
    }
    
    }
});


